import {createApp} from 'vue'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import App from './App.vue'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import router from './router/index.js'
import {useUserInfoStore} from './store/index'


const pinia = createPinia()
pinia.use(piniaPersist)
const app = createApp(App)

const token = sessionStorage.getItem("token")
if (token) {
    useUserInfoStore.token = token
}

app.use(Antd)
app.use(router)
app.use(pinia)

app.mount('#app')
